/*============================================================================*/
/*                                                                            */
/*  FILE       : pospf.h (Position Parameter File)                            */
/*  CONTENTS   : Contains support functions for parameter files that          */
/*               contain the "special" platform positions, parked and         */
/*               neutral.                                                     */
/*----------------------------------------------------------------------------*/
/*    $Archive:: /Software/mbapi/release/include/fileio/pospf.h              $*/
/*   $Revision:: 121                                                         $*/
/*----------------------------------------------------------------------------*/
/*  VISIBILITY : Public                                                       */
/*               Copyright (c) 1997 Motionbase PLC                            */
/*               All rights reserved.                                         */
/*----------------------------------------------------------------------------*/
/*  HISTORY    :                                                              */
/*                                                                            */
/*    Date     Author    Description                                          */
/*  24/02/98     RND     Created                                              */
/*  12/03/98     KG      mb.h removed                                         */
/*  19/05/99     KG      Added CCONV modifier to export functions from DLL.   */
/*============================================================================*/
#ifndef _POSPF_H_
#define _POSPF_H_

#ifdef __cplusplus
extern "C" {
#endif

/*============================================================================*/
/* INCLUDES                                                                   */
/*============================================================================*/
#include "platform.h"                  /* TPlatformInfo, ...                  */

/*============================================================================*/
/* TYPEDEFS                                                                   */
/*============================================================================*/
/*----------------------------------------------------------------------------*/
/* Enumerate error codes from this module                                     */
/*----------------------------------------------------------------------------*/
typedef enum {
  pospfSUCCESS = 0,
  pospfUNABLE_TO_OPEN_FILE,
  pospfBAD_FILE_FORMAT,
  pospfBAD_FORMAT_VERSION,
  pospfNULL_POINTER,
  pospfLAST_ERROR
} TPOSPFError;

/*----------------------------------------------------------------------------*/
/* Define structure to hold data related to a platform that is stored in a    */
/* Platform Parameter File                                                    */
/*----------------------------------------------------------------------------*/
typedef struct
{
  TKinematicsInputs parkedPosition;   /* Parameters downloaded to NextMove.   */
  TKinematicsInputs neutralPosition;  /* Parameters downloaded to NextMove.   */
} TPositionParameters;

/*============================================================================*/
/* FUNCTION PROTOTYPES                                                        */
/*============================================================================*/
/*----------------------------------------------------------------------------*/
/* readPositionParameterFile                                                  */
/* Reads the contents of a Position Parameter File into provided data         */
/* structure.                                                                 */
/*                                                                            */
/* Args:                                                                      */
/* filePath        - full path to the Position Parameter File                 */
/* expectedVersion - the file format version that this module expects to see  */
/* pPOSP           - pointer to Position Parameter structure where data       */
/*                   should be stored                                         */
/*                                                                            */
/* Return:                                                                    */
/* pospfXXX enumeration                                                       */
/*----------------------------------------------------------------------------*/
CCONV TPOSPFError readPositionParameterFile (CHAR* filePath,
                                             INT* expectedVersion,
                                             TPositionParameters* pPOSP);

/*----------------------------------------------------------------------------*/
/* pospfErrorMessage                                                          */
/* Returns an error message associated with a module error code               */
/*                                                                            */
/* Args:                                                                      */
/* error - the error code for which a message is required.                    */
/*                                                                            */
/* Return:                                                                    */
/* Pointer to a message string.                                               */
/*----------------------------------------------------------------------------*/
CCONV const CHAR* pospfErrorMessage (TPOSPFError error);

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /* _POSPF_H_ */
/*============================================================================*/
/* END OF FILE                                                                */
/*============================================================================*/
